// 部门配置
import {deepCopy} from '@/utils/tools'

let map = {

    // listOrdersByCompany: 'company',
    
    // listOrdersOfDepartment: 'department',
    
    // listAccountsByCompany: 'company',
    
    // listAccountsByDepartment: 'department',
    
    // listDepartment: 'company',

    // listCompanies: 'department',
    
    crossCompany: 'company',

    crossDepartment: 'department',
    
}

export default (powerConf, data):any =>{

    let keys = []
    
    Object.keys(map).forEach(key =>{

        if(powerConf[key]){
            keys.push(map[key])
        }
        
    })

    let keyStore = new Set(keys)
    
    // 可查看分公司数据
    if(keyStore.has('company')){
        return data['complete']
    }

    // 可查看分部门数据
    if(keyStore.has('department')){
        
        return [data.company];
    }
    

    return [data.department]
}